#ifndef VECTOR2_H
#define VECTOR2_H

#include "bga/system/Tuple.h"

/**
 * \namespace bga
 * \brief API namespace
 */
namespace bga
{

/**
 * \class Vector
 * \brief this class represents a Vector of 2 Elements
 */
template< typename T>
class Vector2 : public Tuple<2, T>
{
     public:
        /**
         * Default Constructor
         */
        Vector2();

        /**
         * Constructor unsing fields
         * \param x : x value
         * \param y : y value
         */
        Vector2(T x, T y);

        /**
         * Copy Constructor
         */
        Vector2(const Vector2<T>& vector);

        /**
         * Destructor
         */
        virtual ~Vector2();

        T getX() const ;
        T getY() const ;

        void setX(T X);
        void setY(T Y);

        void setXY(T X, T Y);

        double getNorm() const;

        void normalize();
        static Vector2<T> normalize(const Vector2<T>& aNormer);

        Vector2<T> operator+(const Vector2<T> &V) const;
        Vector2<T>& operator+=(const Vector2<T> &V);

        Vector2<T> operator-(const Vector2<T> &V) const;
        Vector2<T>& operator-=(const Vector2<T> &V);

        template< typename U >
        Vector2<T> operator*(U value) const;
        double operator*(const Vector2<T>& v) const;

        /**
         * Operator needed to assign new value to the current vector
         * \param v : Vector to assign to current vector
         */
        Vector2<T>& operator=(const Vector2<T>& v);

};

typedef Vector2<int>    Vector2i;
typedef Vector2<float>  Vector2f;
typedef Vector2<double> Vector2d;

}

#include "bga/math/Vector2.inl"



#endif // VECTOR2_H

